<?php
function ConnectDB(){
    $link = mysqli_connect("localhost","root","bananadine777","BrickCMS")or die("Error " . mysqli_error($link));
    return $link;
}
function SetupSettings(){
    $Con = ConnectDB();
    $Q1 = "CREATE TABLE IF NOT EXISTS Settings(Property VARCHAR(50), Value VARCHAR(50))";
    $Q2 = "INSERT INTO Settings (Property) VALUES ('MastheadCornerRadius','MastheadWidth','MastheadVPad')";
    
    mysqli_query($Con,$Q1);
    mysqli_query($Con,$Q2);
}
function SetupUsers(){
    $Con = ConnectDB();
    $Q1 = "CREATE TABLE IF NOT EXISTS Users(FirstName VARCHAR(50), LastName VARCHAR(50),Thumbnail VARCHAR(50),EmailAddress VARCHAR(50),Password VARCHAR(50),FavourateColour VARCHAR(50))";
    mysqli_query($Con,$Q1);
}
function SetupArticle(){
    $Con = ConnectDB();
    $Q1 = "CREATE TABLE IF NOT EXISTS Settings(FirstName VARCHAR(50), Thumbnail VARCHAR(50),DateStamp TIMESTAMP(),Article TEXT(2000))";
    mysqli_query($Con,$Q1);
}
function SetupBrick(){
    $Con = ConnectDB();
    $Q1 = "CREATE TABLE IF NOT EXISTS Bricks(Name VARCHAR(50),Id INT(4),GlobalAttributes VARCHAR(100),Width VARCHAR(5),Height VARCHAR(5),BorderWidth VARCHAR(5),BorderStyle VARCHAR(50),BorderColour VARCHAR(7),Gradient-Direction VARCHAR(40),Gradient-Colour VARCHAR(500),BrickFunction VARCHAR(50),BrickGenerator VARCHAR(50),BrickParameters VARCHAR(50))"
    mysqli_query($Con,$Q1);
    
    
    #add the following:
    #Name VARCHAR(50),
    #Id INT(4),
    #GlobalAttributes VARCHAR(100),
    #Width VARCHAR(5),
    #Height VARCHAR(5),
    #BorderWidth VARCHAR(5),
    #BorderStyle VARCHAR(50),
    #BorderColour VARCHAR(7),
    #Gradient-Direction VARCHAR(40), #to right - research css gradients
    #Gradient-Colour VARCHAR(500),#Comma Seperated Hex Values
    #BrickFunction VARCHAR(50),
    #BrickGenerator VARCHAR(50),
    #BrickParameters VARCHAR(50))
}
?>